package com.dragon.app.other;

import org.junit.jupiter.api.Test;

import java.util.Collections;

/**
 * @Author: longtao
 * @Date: 2019/8/30
 * @Version: 1.0
 * @Description:
 */
public class T5 {

    public static void main(String[] args) {
        Collections.singleton(new Object());


//        int a = 5; //
//
//        int b = a<<1;
//
//        int c = b<<1;
//
//        System.out.println(a|b|c);
//        System.out.println(a^b^c);
        System.out.println(bitAdd(455,111));


        Test test =new Test();
        System.out.println("商是："+test.divide(9, 4));


        System.out.println(0Xff);

    }

    public static int bitAdd(int m, int n){
        int m1=m&n;
        int n1=m^n;

        if(m1==0)
            return n1;
        else
            return bitAdd(m1<<1,n1);
    }


    public static class Test{
        public int divide(int a,int b){
            try {
                return a/b;
            }
            catch (Exception e) {
                System.out.println("catch语句块");
                return b;
            }
            finally{
                System.out.println("finally语句块");
                b=1;
            }
        }
    }



}
